package com.validator.domain;

import lombok.Data;

import javax.validation.constraints.*;

/**
 * 用户vo
 *
 * @author Amadeus
 * @date 2024/04/03
 */
@Data
public class UserVo {

    @NotBlank(message = "昵称不能为空")
    private String niceName;

    @NotNull(message = "年龄不能为空")
    @Min(value = 1, message = "年龄不能小于1")
    @Max(value = 200, message = "年龄不能大于200")
    private Integer age;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式有误")
    private String email;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3,4,5,6,7,8,9]{1}[0-9]{9}$", message = "手机号格式有误")
    private String telephone;

}
